package cn.ucox.web.ms.polling;

/**
 * 数据同步锚记信息
 *
 * @author chenw
 * @create 2017-05-11 11:12
 * @email javacspring@gmail.com
 */
public class SyncAnchor {

    //上一次同步时间(sst)
    private long syncStartTime;
    //上一次数据同步任务结束时间(set)
    private long syncEndTime;
    //上一次同步时间(sst)
    private String syncStartTimeStr;
    //上一次数据同步任务结束时间(set)
    private String syncEndTimeStr;
    //上一次同步操作编号(tid),从1亿开始编号主要是为FTP根据文件名称排序
    private long transactionId = 100000000L;
    //上一次同步数据按日期排序后，第一条记录时间(开始)，对应OS_DEX_SYNC表CTM字段值(dst)
    private String dataStartTime = "0";
    //上一次同步数据按日期排序后，最后一条记录时间(结束)，对应OS_DEX_SYNC表CTM字段值(det)
    private String dataEndTime = "0";


    private long syncMediumStartTime;//msst
    private long syncMediumEndTime;//mset
    private String syncMediumStartTimeStr;//msst
    private String syncMediumEndTimeStr;//mset
    private String dataMediumStartTime = "0";//mdst
    private String dataMediumEndTime = "0";//mdet

    private long syncLowStartTime;//lsst
    private long syncLowEndTime;//lset
    private String syncLowStartTimeStr;//lsst
    private String syncLowEndTimeStr;//lset
    private String dataLowStartTime = "0";//ldst
    private String dataLowEndTime = "0";//ldet


    //数据处理子任务数量(ttn)
    private int totalTaskNum = 0;
    //数据处理子任务完成数量(tdn)
    private int taskDoneNum = 0;
    //事务数据总条数(tdr)
    private int transactionDataRows;
    //事务数据大小，单位为字节(tds)
    private long transactionDataSize;
    //FTP同步目录滞留文件数据
    private int maxFtpDetention = 0;

    //事务数据入列工作完成
    private String transProcessDone = "Y";

    /**
     * 判断当前事务是否完成
     *
     * @return true完成事务 false未完成
     */
    public boolean isTransactionDone() {
        return this.transProcessDone.equals("Y");
    }

    /**
     * 重置同步锚点信息
     */
    public void reset() {
        this.transactionDataRows = 0;
        this.transactionDataSize = 0;
        this.totalTaskNum = 0;
        this.taskDoneNum = 0;
        this.maxFtpDetention = 0;
        this.transProcessDone = "N";
    }

    public long getSyncStartTime() {
        return syncStartTime;
    }

    public void setSyncStartTime(long syncStartTime) {
        this.syncStartTime = syncStartTime;
    }

    public long getSyncEndTime() {
        return syncEndTime;
    }

    public void setSyncEndTime(long syncEndTime) {
        this.syncEndTime = syncEndTime;
    }

    public long getTransactionId() {
        return transactionId;
    }

    public void setTransactionId(long transactionId) {
        this.transactionId = transactionId;
    }

    public String getDataStartTime() {
        return dataStartTime;
    }

    public void setDataStartTime(String dataStartTime) {
        this.dataStartTime = dataStartTime;
    }

    public String getDataEndTime() {
        return dataEndTime;
    }

    public void setDataEndTime(String dataEndTime) {
        this.dataEndTime = dataEndTime;
    }

    public int getTotalTaskNum() {
        return totalTaskNum;
    }

    public void setTotalTaskNum(int totalTaskNum) {
        this.totalTaskNum = totalTaskNum;
    }

    public int getTaskDoneNum() {
        return taskDoneNum;
    }

    public void setTaskDoneNum(int taskDoneNum) {
        this.taskDoneNum = taskDoneNum;
    }

    public int getTransactionDataRows() {
        return transactionDataRows;
    }

    public void setTransactionDataRows(int transactionDataRows) {
        this.transactionDataRows = transactionDataRows;
    }

    public long getTransactionDataSize() {
        return transactionDataSize;
    }

    public void setTransactionDataSize(long transactionDataSize) {
        this.transactionDataSize = transactionDataSize;
    }

    public String getTransProcessDone() {
        return transProcessDone;
    }

    public void setTransProcessDone(String transProcessDone) {
        this.transProcessDone = transProcessDone;
    }

    public int getMaxFtpDetention() {
        return maxFtpDetention;
    }

    public void setMaxFtpDetention(int maxFtpDetention) {
        this.maxFtpDetention = maxFtpDetention;
    }

    public String getSyncStartTimeStr() {
        return syncStartTimeStr;
    }

    public void setSyncStartTimeStr(String syncStartTimeStr) {
        this.syncStartTimeStr = syncStartTimeStr;
    }

    public String getSyncEndTimeStr() {
        return syncEndTimeStr;
    }

    public void setSyncEndTimeStr(String syncEndTimeStr) {
        this.syncEndTimeStr = syncEndTimeStr;
    }

    public long getSyncMediumStartTime() {
        return syncMediumStartTime;
    }

    public void setSyncMediumStartTime(long syncMediumStartTime) {
        this.syncMediumStartTime = syncMediumStartTime;
    }

    public long getSyncMediumEndTime() {
        return syncMediumEndTime;
    }

    public void setSyncMediumEndTime(long syncMediumEndTime) {
        this.syncMediumEndTime = syncMediumEndTime;
    }

    public String getSyncMediumStartTimeStr() {
        return syncMediumStartTimeStr;
    }

    public void setSyncMediumStartTimeStr(String syncMediumStartTimeStr) {
        this.syncMediumStartTimeStr = syncMediumStartTimeStr;
    }

    public String getSyncMediumEndTimeStr() {
        return syncMediumEndTimeStr;
    }

    public void setSyncMediumEndTimeStr(String syncMediumEndTimeStr) {
        this.syncMediumEndTimeStr = syncMediumEndTimeStr;
    }

    public String getDataMediumStartTime() {
        return dataMediumStartTime;
    }

    public void setDataMediumStartTime(String dataMediumStartTime) {
        this.dataMediumStartTime = dataMediumStartTime;
    }

    public String getDataMediumEndTime() {
        return dataMediumEndTime;
    }

    public void setDataMediumEndTime(String dataMediumEndTime) {
        this.dataMediumEndTime = dataMediumEndTime;
    }

    public long getSyncLowStartTime() {
        return syncLowStartTime;
    }

    public void setSyncLowStartTime(long syncLowStartTime) {
        this.syncLowStartTime = syncLowStartTime;
    }

    public long getSyncLowEndTime() {
        return syncLowEndTime;
    }

    public void setSyncLowEndTime(long syncLowEndTime) {
        this.syncLowEndTime = syncLowEndTime;
    }

    public String getSyncLowStartTimeStr() {
        return syncLowStartTimeStr;
    }

    public void setSyncLowStartTimeStr(String syncLowStartTimeStr) {
        this.syncLowStartTimeStr = syncLowStartTimeStr;
    }

    public String getSyncLowEndTimeStr() {
        return syncLowEndTimeStr;
    }

    public void setSyncLowEndTimeStr(String syncLowEndTimeStr) {
        this.syncLowEndTimeStr = syncLowEndTimeStr;
    }

    public String getDataLowStartTime() {
        return dataLowStartTime;
    }

    public void setDataLowStartTime(String dataLowStartTime) {
        this.dataLowStartTime = dataLowStartTime;
    }

    public String getDataLowEndTime() {
        return dataLowEndTime;
    }

    public void setDataLowEndTime(String dataLowEndTime) {
        this.dataLowEndTime = dataLowEndTime;
    }
}
